<!--
 * @Author: Fu Zhuohang
 * @Date: 2022-01-04 18:06:33
 * @LastEditors: Fu Zhuohang
 * @LastEditTime: 2022-03-04 17:52:33
 * @FilePath: \yunshu6.0\entries\portal\src\views\workflow-center\my-workflow.vue
 * @Description: 
-->
<template>
  <my-workflow :storeId="storeId" @openForm="openForm"/>
</template>

<script lang="ts">

// 初始化表单组件配置
import "@/config/h3-form";
import Store from '@/store/index';
import flowCenter from '@cloudpivot/flow-center/pc';
import { Component, Vue } from 'vue-property-decorator';




@Component({
  name: 'Workflow',
  components: {
    myWorkflow: flowCenter.components.MyWorkflow
  }
})
export default class Workflow extends Vue {
  
  storeId: string = ''

  mounted(){
    this.storeId = (Store.state as any).System.System.loginedUserInfo && (Store.state as any).System.System.loginedUserInfo.id
  }
  /**
   * 查看表单详情
   */
  openForm(obj:any) {
    const url = `/form/detail?workitemId=${obj.id}&workflowInstanceId=${obj.instanceId}&return=${location.pathname + location.search}&workitemType=myWorkflow`;
    if (this.isDingTalk) {
      this.$router.push({
        path: url
      }).catch((err: any) => {err});
    } else {
      const newWindow: any = window.open();
      newWindow.location.href = url;
    }
  }
}
</script>

<style lang='less' scoped>

</style>
